from django.db import models

from utis.basemodel import BaseModel


# Create your models here.


class Category(BaseModel):
    name = models.CharField(max_length=100, verbose_name='分类名称')
    parent = models.ForeignKey("self", on_delete=models.CASCADE, null=True, blank=True, verbose_name='父级',
                               related_name="children")
    intro = models.CharField(max_length=200)

    class Meta:
        verbose_name = 'fgcategory'

    def __str__(self):
        return self.name

